﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using TerminationCall.Core;

namespace TerminationCall.Editor.GUI
{
    public partial class MainForm : Form
    {

        public TilesForm TilesForm {
            get;
            set;
        }
        public LevelForm LevelForm {
            get;
            set;
        }
        public ToolsetForm ToolsetForm {
            get;
            set;
        }

        public MainForm()
        {
            InitializeComponent();
        }

        private void saveAsToolStripMenuItem_Click(object sender, EventArgs e) {

            if (sfdSaveLevel.ShowDialog() == DialogResult.OK) {

                LevelSaver levelSaver = new LevelSaver();
                levelSaver.Save(sfdSaveLevel.FileName, LevelForm.EditorTool.Level);

            }

        }

        private void openToolStripMenuItem_Click(object sender, EventArgs e) {

            if (ofdOpenLevel.ShowDialog() == DialogResult.OK) {

                LevelLoader levelLoader = new LevelLoader();
                LevelForm.EditorTool.Level = levelLoader.Load(ofdOpenLevel.FileName);

            }

        }

    }
}
